home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / octa209s.zip / octave-2.09 / src / Stack.h < prev    next >
C/C++ Source or Header  |  1997-03-07  |  2KB  |  72 lines

  1. /*
  2.  
  3. Copyright (C) 1996 John W. Eaton
  4.  
  5. This file is part of Octave.
  6.  
  7. Octave is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2, or (at your option) any
  10. later version.
  11.  
  12. Octave is distributed in the hope that it will be useful, but WITHOUT
  13. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15. for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with Octave; see the file COPYING.  If not, write to the Free
  19. Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  20.  
  21. */
  22.  
  23. /*
  24.  
  25. The classes in this file are derived from the old `genclass' version
  26. of Stack from libg++, originally:
  27.  
  28.   Copyright (C) 1988 Free Software Foundation
  29.     written by Doug Lea (dl@rocky.oswego.edu)
  30.  
  31. and distributed under the terms of the GNU Library General Public
  32. License as published by the Free Software Foundation.
  33.  
  34. */
  35.  
  36. #if !defined (_Stack_h)
  37. #define _Stack_h 1
  38.  
  39. #if defined (__GNUG__)
  40. #pragma interface
  41. #endif
  42.  
  43. template <class T>
  44. class
  45. Stack
  46. {
  47.  public:
  48.  
  49.   Stack (void) { }
  50.  
  51.   virtual ~Stack (void) { }
  52.  
  53.   virtual void push (const T& item) = 0;
  54.  
  55.   virtual T pop (void) = 0;
  56.   virtual T& top (void) = 0; 
  57.  
  58.   virtual void del_top (void) = 0;
  59.  
  60.   virtual int empty (void) = 0;
  61.   virtual int full (void) = 0;
  62.   virtual int length (void) = 0;
  63.  
  64.   virtual void clear (void) = 0;
  65.  
  66.   void error (const char *msg);
  67.  
  68.   virtual int OK (void) = 0;
  69. };
  70.  
  71. #endif
  72.